
#ifndef DHDM_H
#define DHDM_H


#include "dhnetsdk.h"
#include <list>

using namespace std;




//---------------------------The macro definition-----------------------------------------
//#define DF_CHANNEL

// 	alarm type
typedef enum 
{
	DH_OTHER_ALARM = 0,
	DH_COMMON_ALARM,
	DH_INPUT_ALARM,
	DH_MOTIONDETECT_ALARM,
	DH_VIDEOLOST_ALARM,
	DH_VIDEOSHELTER_ALARM,
	DH_SOUNDDETECT_ALARM,
	DH_DISKFULL_ALARM,
	DH_DISKERROR_ALARM,
} DH_ALARM_TYPE;


//---------------------------The type definition--------------------------------------
//	channel information
#ifdef DF_CHANNEL
typedef struct 
{
	long				lRealPlayHandle;
	unsigned long		dwStatistic;
} DH_Channel_Info;
#endif

//  alarm information
typedef struct 
{
	BYTE alarmType;

	BYTE diskFull;
	DWORD diskError;
	WORD soundDetect;
	WORD shelterAlarm;

	WORD motionDetect;
	WORD videoLost;
	WORD inputAlarm;

	BYTE channelCount;
	BYTE alarmInputCount;
} DH_Alarm_Info;

//	device information
typedef struct 
{
	long				lLoginHandle;
	char				szDevIp[16];
	int					nPort;
	char				szUserName[16];
	char				szPassWord[16];
	BYTE				bOnline;
	int					protocalVersion;
	DH_Alarm_Info		alarm;
#ifdef DF_CHANNEL
	int					nChannelCount;
	DH_Channel_Info		channel[16];
#endif
} DH_Device_Info;

typedef std::list<DH_Device_Info*> DEVICE_LIST;


//---------------------------The function prototype---------------------------------------
// Return: 0--fail, 1--OK
int InitDMEnv();

void DestroyDMEnv();

void StartDevices();

void StopDevices();


#endif // DHDM_H

